We only emit player-added for players that can play, but we remove them
all, despite this state.
This causes a non-fatal warning during the removal of a non-existent
notification (that is in fact an undefined message)
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/8284
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4183>
if (player) {
this._players.delete(name);
player.disconnectObject(this);
- this.emit('player-removed', player);
+
+ // if !canPlay, the player has already been removed
+ // or was never exposed in our public players list
+ if (player.canPlay)
+ this.emit('player-removed', player);
}
}